import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  //================================= three layer frame start===================================
  {
    path: '/three/login',
    name: 'three/login',
    component: () => import('../views/three_frame/system_user/LoginView.vue')
  },
  {
    path: '/three/system/list',
    name: 'three/system/list',
    component: () => import('../views/three_frame/system_user/ListView.vue')
  },
  //================================= three layer frame end===================================

  {
    path: '/login',
    name: 'login',
    component: () => import('../views/LoginView.vue')
  },
  {
    path: '/default',
    name: 'default',
    component: () => import('../views/DefaultView.vue'),
    children: [
      {
        path: '/product/list',
        name: 'product/list',
        component: () => import('../views/product/ListView.vue')
      },
      {
        path: '/order/list',
        name: 'order/list',
        component: () => import('../views/order/ListView.vue')
      },
      // {
      //   path: '/order/detail',
      //   name: 'order/detail',
      //   component: () => import('../views/order/DetailView.vue')
      // },
      {
        path: '/order/add',
        name: 'order/add',
        component: () => import('../views/order/AddView.vue')
      },
      {
        path: '/order/list2',
        name: 'order/list2',
        component: () => import('../views/order/List2View.vue')
      },
      {
        path: '/asynle/echarts',
        name: 'asynle/echarts',
        component: () => import('../views/asynle/EchartsView.vue')
      }
    ]
  },
  {
    path: '/product/category/list',
    name: 'product/category/list',
    component: () => import('../views/product/CategoryListView.vue')
  },

  {
    path: '/product/add',
    name: 'product/add',
    component: () => import('../views/product/AddView.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
